package org.nidy.erp.controller;

import lombok.extern.slf4j.Slf4j;
import org.nidy.erp.service.IBigHomeMiniProgrameService;
import org.nidy.erp.utils.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/bigHomeMiniPrograme")
@CrossOrigin(origins = "*", maxAge = 3600)
@Slf4j
public class BigHomeMiniProgrameController {
    @Autowired
    private IBigHomeMiniProgrameService bigHomeMiniProgrameService;

    @GetMapping("/getSwiperList")
    public ResponseResult getSwiperList(){
        ResponseResult swiperList = bigHomeMiniProgrameService.getSwiperList();
        return swiperList;
    };

    @GetMapping("/getBigTypeList")
    public ResponseResult getBigTypeList(){
        List<Map<String, Object>> bigTypeList = bigHomeMiniProgrameService.getBigTypeList();
        return ResponseResult.success(bigTypeList);
    }

    @GetMapping("/getGoodsList")
    public ResponseResult getGoodsList(){
        List<Map<String, Object>> goodsList = bigHomeMiniProgrameService.getGoodsList();

        return ResponseResult.success(goodsList);
    }
}
